<!--
*Author：富行天下团队
 *
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/mall/Mall_product.js此处编写
 -->
<template>
  <div>
    <view-grid ref="grid" :columns="columns" :detail="detail" :editFormFileds="editFormFields" :editFormOptions="editFormOptions" :searchFormFileds="searchFormFields"
      :searchFormOptions="searchFormOptions" :table="table" :extend="extend">
    </view-grid>
  </div>
</template>

<script>
import extend from '@/extension/mall/Mall_product.js'
import ViewGrid from '@/components/basic/ViewGrid.vue'
import maillabel from './Mall_label.vue'
// import productType from '../../extension/mall/product/producttype.vue'
//import producttype from '../../extension/mall/product/Producttype.vue'
// import choosereservation from "../../mall/volumn/ChooseReservation.vue";
var vueParam = {
  components: {
    ViewGrid,
    maillabel,
  },
  data() {
    return {
      show: false,
      typeShow: false,
      table: {
        key: 'id',
        footer: 'Foots',
        cnName: '产品列表',
        name: 'Mall_product',
        url: '/Products/',
        sortName: 'createDate',
      },
      formFileds: {},
      //{"UserName":"","UserTrueName":"","Role_Id":"","IsRegregisterPhone":"","Gender":"","Enable":"","CreateDate":"","Creator":"","Remark":"","HeadImageUrl":""},
      extend: extend,
      editFormFields: {
        name: '',
        name2: '',
        code: '',
        typename: '',
        costprice: '',
        type: '',
        description: '',
        rulesOfUse: '',
        carouselCode: '',
        deposit: '',
        unit: '',
        mainLabel: '',
        auxiliaryLabel: '',
        effectiveStartDate: '',
        effectiveEndDate: '',
        picid: [],
        txtid: '',
        isPackage: 0,
        creator: '',
        createID: '',
        createDate: '',
        modifier: '',
        modifyID: '',
        modifyDate: '',
        merchantCode: '',
        merchantName: '',
        hotelName: '',
        pmsRoomCode: '',
      },
      editFormOptions: [
        [
          { title: '产品名称', required: true, field: 'name', type: 'text' },
          { title: '产品类型', required: true, field: 'type', colSize: 6, hidden: true },
          { title: '产品类型', field: 'typename', colSize: 6, hidden: true },
          { title: '简称', field: 'name2', type: 'text' },
        ],
        [
          { title: '成本价', required: true, field: 'costprice', type: 'decimal' },
          { title: '开始时间', required: true, field: 'effectiveStartDate', type: 'date' },
          { title: '结束时间', required: true, field: 'effectiveEndDate', type: 'date' },
          { title: '单位', required: true, field: 'unit', type: 'select', dataKey: 'unit' },
        ],
        [
          { title: '教学时长', field: 'spare5', type: 'select', dataKey: 'attr_jxsc', colSize: 6, hidden: true },
          { title: '教学等级', field: 'spare6', type: 'select', dataKey: 'attr_jxdj', colSize: 6, hidden: true },
        ],
        [
          { title: '酒店名称', required: false, field: 'hotelName', type: 'select', dataKey: 'Hotels', colSize: 6, hidden: true },
          { title: 'pms房价码', required: false, field: 'pmsRoomCode', type: 'text', colSize: 6, hidden: true },
        ],
        [
          { title: '主标签', required: true, field: 'mainLabel', type: 'select', dataKey: 'Label', colSize: 6 },
          { title: '辅助标签', required: true, field: 'auxiliaryLabel', type: 'selectList', dataKey: 'Label', colSize: 6 },
        ],
        [
          { title: '封面图片', required: false, field: 'picid', type: 'imgupgrade' },
          { title: '是否套票', required: true, field: 'isPackage', type: 'switch', dataKey: 'enable' },
          { title: '详情介绍', required: true, field: 'txtid', type: 'select', dataKey: 'mall_test' },
          { title: '押金', field: 'deposit', type: 'decimal' },
        ],
        [
          { title: '轮播图', field: 'carouselCode', type: 'select', dataKey: 'mall_product_carousel', hidden: true },
          { title: '描述', required: true, field: 'description', type: 'text' },
          { title: '预订须知', field: 'bookingNotice', type: 'select', dataKey: 'mall_book' },
          { title: '使用规则', field: 'rulesOfUse', type: 'text' },
        ],
        [{ title: '简称', field: 'code', type: 'text', hidden: true }],
      ],
      searchFormFields: { code: '', name: '', name2: '', typename: '', effectiveStartDate: '', effectiveEndDate: '', isPackage: '', creator: '' },
      searchFormOptions: [
        [
          { title: '名称', field: 'name', type: 'like' },
          { title: '产品类型', field: 'type', type: 'select', dataKey: 'pro_type' },
          { title: '主标签', field: 'mainLabel', type: 'select', dataKey: 'Label' },
        ],
        [
          { title: '有效开始时间', field: 'effectiveStartDate', type: 'datetime' },
          { title: '是否套票', field: 'isPackage', type: 'select', dataKey: 'enable' },
          { title: '单位', field: 'unit', type: 'select', dataKey: 'unit' },
        ],
      ],
      columns: [
        { field: 'id', title: '主键', type: 'string', width: 90, hidden: true, readonly: true, require: true, align: 'left' },
        //    {field:'code',title:'编码',type:'string',width:150,align:'left'},
        { field: 'name', title: '名称', type: 'string', width: 150, align: 'left', sortable: true },
        { field: 'name2', title: '简称', type: 'string', width: 150, align: 'left' },
        { field: 'costprice', title: '成本价', type: 'decimal', width: 90, align: 'left' },
        { field: 'mainLabelname', title: '主标签', bind: { key: 'Label', data: [] }, type: 'string', width: 150, align: 'left' },
        { field: 'auxiliaryLabelname', title: '辅助标签', bind: { key: 'Label', data: [] }, type: 'string', width: 150, align: 'left' },
        { field: 'typename', title: '产品类型', bind: { key: 'pro_type', data: [] }, type: 'string', width: 150, align: 'left' },
        { field: 'unitname', title: '单位', bind: { key: 'unit', data: [] }, type: 'string', width: 90, align: 'left' },
        { field: 'bookingNotice', title: '预订须知', bind: { key: 'mall_book', data: [] }, type: 'string', width: 150, align: 'left' },
        { field: 'description', title: '描述', type: 'string', width: 90, align: 'left' },
        { field: 'rulesOfUse', title: '使用规则', type: 'string', width: 90, align: 'left' },
        { field: 'isPackage', title: '是否套票', bind: { key: 'enable', data: [] }, type: 'byte', width: 90, align: 'left' },
        { field: 'picid', title: '封面图片', type: 'imgupgrade', width: 220, align: 'left' },
        { field: 'carouselCode', title: '轮播图名称', bind: { key: 'mall_product_carousel', data: [] }, type: 'string', width: 220, align: 'left' },
        { field: 'txtidname', title: '详情介绍', bind: { key: 'mall_test', data: [] }, type: 'string', width: 220, align: 'left' },
        { field: 'effectiveStartDate', title: '有效开始时间', type: 'datetime', width: 120, align: 'left', sortable: true },
        { field: 'effectiveEndDate', title: '有效结束时间', type: 'datetime', width: 120, align: 'left', sortable: true },
        { field: 'deposit', title: '押金', type: 'decimal', width: 90, align: 'left' },
        { field: 'modifier', title: '修改人', type: 'string', width: 90, align: 'left' },
        { field: 'modifyDate', title: '修改时间', type: 'datetime', width: 135, align: 'left', sortable: true },
        //{field:'modifyID',title:'修改人ID',type:'int',width:90,hidden:true,align:'left'},
        { field: 'createDate', title: '创建时间', type: 'datetime', width: 135, align: 'left', sortable: true },
        // {field:'createID',title:'创建人ID',type:'int',width:90,hidden:true,align:'left'},
        { field: 'creator', title: '创建人', type: 'string', width: 90, align: 'left' },
        //    {field:'isDisabled',title:'是否',type:'int',width:90,align:'left'},
        //    {field:'isDelete',title:'是否删除',type:'int',width:90,align:'left'},
        //    {field:'spare1',title:'扩展字段1',type:'string',width:220,align:'left'},
        //    {field:'spare2',title:'扩展字段1',type:'string',width:220,align:'left'},
        //    {field:'spare5',title:'扩展字段1',type:'string',width:220,align:'left'},
        //    {field:'spare6',title:'扩展字段1',type:'string',width:220,align:'left'},
        //    {field:'spare7',title:'扩展字段1',type:'string',width:220,align:'left'},
        //    {field:'spare8',title:'扩展字段1',type:'string',width:220,align:'left'},
        //    {field:'spare9',title:'扩展字段1',type:'string',width:220,align:'left'},
        //    {field:'spare10',title:'扩展字段1',type:'string',width:220,align:'left'},
        //    {field:'spare11',title:'扩展字段1',type:'string',width:220,align:'left'},
        //    {field:'spare12',title:'扩展字段1',type:'string',width:220,align:'left'},
        //    {field:'spare13',title:'扩展字段1',type:'string',width:220,align:'left'},
        //    {field:'spare14',title:'扩展字段1',type:'string',width:220,align:'left'},
        //    {field:'spare15',title:'扩展字段1',type:'string',width:220,align:'left'},
      ],
      detail: {
        cnName: '商品管理',
        columns: [
          //     {field:'id',title:'主键',type:'string',width:90,hidden:true,readonly:true,require:true,align:'left'},
          //    {field:'name',title:'名称',type:'string',width:100,align:'left',sortable:true,edit:{type:'text'},require:true},
          //    {field:'code',title:'编码',type:'string',width:100,align:'left',sortable:true,edit:{type:'text'},require:true},
          //    {field:'name2',title:'简称',type:'string',width:100,align:'left',edit:{type:'text'},require:true},
          // //    {field:'productID',title:'产品ID',type:'string',width:90,align:'left'},
          //    {field:'uiType',title:'ui类型',type:'string',bind:{key:'uiType', data:[]},edit:{type:'select'},width:120,align:'left',require:true},
          //    {field:'originalPrice',title:'原价',type:'decimal',width:120,align:'left',edit:{type:'decimal'},require:true},
          //    {field:'preferentialPrice',title:'优惠价',type:'decimal',width:120,align:'left',edit:{type:'decimal'}},
          //    {field: 'spare1', title: "时段",type: 'string',bind:{key:'attr_sd', data:[]},edit:{type:'select'},hidden:true, width: 100},
          //    {field: 'spare2', title: "教学人数",type:'string',bind:{key:'attr_jxrs', data:[]},edit:{type:'select'},hidden:true, width: 100},
          //    {field: 'spare3', title: "淡旺季",type: 'string',bind:{key:'attr_dwj', data:[]},edit:{type:'select'},hidden:true, width: 100},
          //    {field: 'spare4', title: "教学等级",type: 'string',bind:{key:'attr_jxdj', data:[]},edit:{type:'select'},hidden:true, width: 100},
          //    {field: 'spare5', title: "教学时长",type: 'string',bind:{key:'attr_jxsc', data:[]},edit:{type:'select'},hidden:true, width: 100},
          //    {field: 'spare6', title: "滑雪时长",type: 'string',bind:{key:'attr_hxsc', data:[]},edit:{type:'select'},hidden:true, width: 100},
          //    {field:'spare7',title:'日期',type:'string',bind:{key:'attr_rq', data:[]},edit:{type:'select'},hidden:true, width: 100},
          //    {field:'spare9',title:'扩展字段1',type:'string',width:220,align:'left'},
          //    {field:'spare10',title:'扩展字段1',type:'string',width:220,align:'left'},
          //    {field:'spare11',title:'扩展字段1',type:'string',width:220,align:'left'},
          //    {field:'spare12',title:'扩展字段1',type:'string',width:220,align:'left'},
          //    {field:'spare13',title:'扩展字段1',type:'string',width:220,align:'left'},
          //    {field:'spare14',title:'扩展字段1',type:'string',width:220,align:'left'},
          //    {field:'spare15',title:'扩展字段1',type:'string',width:220,align:'left'},
          //    {field:'modifier',title:'修改人',type:'string',width:180,align:'left'},
          //    {field:'modifyDate',title:'修改时间',type:'datetime',width:135,align:'left',sortable:true},
          //    {field:'modifyID',title:'修改人ID',type:'int',width:90,hidden:true,align:'left'},
          //    {field:'createDate',title:'创建时间',type:'datetime',width:135,align:'left',sortable:true},
          //    {field:'createID',title:'创建人ID',type:'int',width:90,hidden:true,align:'left'},
          //    {field:'creator',title:'创建人',type:'string',width:180,align:'left'}
        ],
        sortName: 'id',
        key: 'id',
      },
    }
  },
}
export default vueParam
</script>
